package com.google.code.cakedroid.context;

import com.google.code.cakedroid.base.BaseContext;

import android.content.Context;
import android.content.Intent;

public class FeedbackHelper extends BaseContext {
	
	public FeedbackHelper(Context  context) {
		super(context);
	}

	/**
	 * sendFeedback  by email
	 * @param emailAddress  the destination email address
	 * @param emailSubject   the email subject
	 * @param emailBody        the email body
	 * @param feedbackTitle the feedback title
	 */
	public  void sendFeedbackEmail(String emailAddress,String emailSubject,String emailBody,String feedbackTitle){
		//ʵ��Intent���󣬲���ִ��action
		Intent intent = new Intent(android.content.Intent.ACTION_SEND);
		//���ô�����ݵ�MIME����
		intent.setType("plain/text");
		//���������˵ĵ�ַ����Ϊ���������ͣ�������Ӷ����ÿ���ռ�����Ϊ�����һ����Ԫ
		String[] strEmailReciver = new String[]{emailAddress};
		//�ʼ�������
		intent.putExtra(android.content.Intent.EXTRA_SUBJECT,emailSubject);
		intent.putExtra(android.content.Intent.EXTRA_EMAIL, strEmailReciver); //�����ռ���
		intent.putExtra(android.content.Intent.EXTRA_TEXT, emailBody); //��������
		//����Activity
		this.context.startActivity(Intent.createChooser(intent,feedbackTitle));
		
	}
}
